import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import { resolve } from 'node:path';

// https://vite.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
    },
  },
  build: {
    emptyOutDir: false,
    rollupOptions: {
      input: {
        content: resolve(__dirname, 'src/content.js'),
        contentStyle: resolve(__dirname, 'src/content.css'),
      },
      output: {
        entryFileNames: `[name].js`,
        assetFileNames: `content.css`,
      },
    },
  },
});
